﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
  <class name="FastSpring.Core.Model.WorkFlow,FastSpring.Net.Core" table="Sys_WorkFlow" lazy="false">
    <id name="ID" column="ID" type="Int32">
      <generator class="native" />
    </id>
    <property name="WFName" column="WFName"/>
    <property name="EntityAll" column="EntityAll"/>
    <property name="EntityLogAll" column="EntityLogAll"/>
    <property name="IsActive" column="IsActive"/>
    <bag name="WorkFlowLists" cascade="none" inverse="true" lazy="false" order-by="WorkID">
      <key column="WFID"/>
      <one-to-many class="FastSpring.Core.Model.WorkFlowList,FastSpring.Net.Core" />
    </bag>
  </class>
  <class name="FastSpring.Core.Model.WorkFlowList,FastSpring.Net.Core" table="Sys_WorkFlowList" lazy="false">
    <id name="ID" column="ID" type="Int32">
      <generator class="native" />
    </id>
    <property name="WFID" column="WFID"/>
    <property name="WorkID" column="WorkID"/>
    <property name="WorkName" column="WorkName"/>
    <property name="WorkWhere" column="WorkWhere"/>
    <property name="ModuleCode" column="ModuleCode"/>
    <property name="IsActive" column="IsActive"/>
  </class>
  <class name="FastSpring.Core.Model.WorkFlowTurn,FastSpring.Net.Core" table="Sys_WorkFlowTurn" lazy="false">
    <id name="ID" column="ID" type="Int32">
      <generator class="native" />
    </id>
    <property name="WFID" column="WFID"/>
    <property name="WorkName" column="WorkName"/>
    <property name="WorkValue" column="WorkValue"/>
    <property name="WorkIDFrom" column="WorkIDFrom"/>
    <property name="WorkIDTo" column="WorkIDTo"/>
    <property name="IsEnd" column="IsEnd"/>
    <property name="IsActive" column="IsActive"/>    
  </class>
  <query name="GetWorkFlowListOfWFID">
    <![CDATA[from WorkFlowList workFlowList WHERE workFlowList.WFID=:param1]]>
  </query>
  <query name="GetWorkFlowTurnListOfFromID">
    <![CDATA[from WorkFlowTurn workFlowTurn WHERE workFlowTurn.WFID=:param1 OR workFlowTurn.WorkIDFrom=:param2]]>
</query>
<query name="GetWorkFlowTurnListOfToID">
  <![CDATA[from WorkFlowTurn workFlowTurn WHERE workFlowTurn.WFID=:param1 OR workFlowTurn.WorkIDTo=:param2]]>
  </query>
  <query name="GetAllWorkFlows">
    <![CDATA[from WorkFlow workFlow]]>
  </query>
</hibernate-mapping>

